#include <stdio.h>
#include <math.h>

double _cos(double x);

int main() {

	printf("%.8lf\n", pow((_cos(30.0 / 360.0 * 2 * M_PI) + _cos(60.0 / 360 * 2 * M_PI)), 2));

	return 0;
}

double _cos(double x) {
	double res = 1;
	double cache = 0;
	int negative = 1;
	double base = 1;
	int basePos = 1;
	while ((base *= basePos++, base *= basePos++, negative *= -1, (cache = pow(x, basePos - 1) / base)) > 1.0e-6)
		res += negative * cache;
	return res;
}
